﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _1103SimplePainter
{
    class ImageManClass
    {
        public Bitmap backBMP;
        public Graphics graphics;
        public ImageManClass(int _w, int _h)
        {
            backBMP = new Bitmap(_w, _h);
            graphics = Graphics.FromImage(backBMP);
            graphics.Clear(Color.White);
        }
        public void SaveToFile(string _fileName)
        {
            string ext = Path.GetExtension(_fileName).ToLower();
            if (ext == ".jpg") backBMP.Save(_fileName, ImageFormat.Jpeg);
            if (ext == ".bmp") backBMP.Save(_fileName, ImageFormat.Bmp);
            if (ext == ".png") backBMP.Save(_fileName, ImageFormat.Png);
        }
    }
}
